home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
bbs
/
cddk9606.zip
/
HEADERS.ARJ
/
TYPES.INT
< prev
next >
Wrap
Text File
|
1996-06-14
|
5KB
|
191 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ TYPES: Predefined variable types for SCRIPTS.PAS }
{ Copyright 1996 David Pinch ∙ All Rights Reserved Worldwide }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT Types;
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
USES
Scripts;
TYPE
VarBoolean = OBJECT(tVariable)
BooStrs : ARRAY[False..True] OF STRING[30];
CONSTRUCTOR Init(p:pChar; Addr:Pointer);
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
END;
pVarBoolean = ^VarBoolean;
VarByte = OBJECT(tVariable)
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
END;
pVarByte = ^VarByte;
VarChar = OBJECT(tVariable)
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
END;
pVarChar = ^VarChar;
VarDynamic = OBJECT(tVariable)
DoNotDispose : Boolean;
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
DESTRUCTOR Done; VIRTUAL;
END;
pVarDynamic = ^VarDynamic;
VarLongInt = OBJECT(tVariable)
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
END;
pVarLongInt = ^VarLongInt;
VarTPString = OBJECT(tVariable)
MaxLen : Byte;
CONSTRUCTOR Init(p:pChar; Addr:Pointer; Sz:Byte);
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
END;
pVarTPString = ^VarTPString;
VarString = OBJECT(tVariable)
MaxLen : Word;
CONSTRUCTOR Init(p:pChar; Addr:Pointer; Sz:Byte);
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
END;
pVarString = ^VarString;
VarWord = OBJECT(tVariable)
PROCEDURE Assign(p:pChar); VIRTUAL;
FUNCTION Obtain:STRING; VIRTUAL;
END;
pVarWord = ^VarWord;
VarDirectory = OBJECT(VarDynamic)
PROCEDURE Assign(p:pChar); VIRTUAL;
DESTRUCTOR Done; VIRTUAL;
END;
pVarDirectory = ^VarDirectory;
{#Start}
PROCEDURE RegisterBoolean(Name:pChar; Addr:Pointer);
{
PURPOSE : Registers a boolean variable with the script interpreter.
EXAMPLE : RegisterBoolean('DirectVideo',@CRT.DirectVideo);
}
PROCEDURE RegisterByte(Name:pChar; Addr:Pointer);
{
PURPOSE : Registers a byte with the script interpreter.
EXAMPLE : RegisterByte('TextAttr',@CRT.TextAttr);
}
PROCEDURE RegisterChar(Name:pChar; Addr:Pointer);
{
PURPOSE : Registers a character with the script interpeter.
EXAMPLE : RegisterChar('YourChar',@YourChar);
}
PROCEDURE RegisterDirectory(Name:pChar; Addr:Pointer);
{
Registers a pChar holding a directory name. The object makes sure that
the string always contains a terminating slash character (/). The string
is automatically disposed upon termination of the door.
}
PROCEDURE RegisterDynamic(Name:pChar; Addr:Pointer);
{
PURPOSE : Registers a pChar with the script interpreter. The string
is automatically disposed with StrDispose upon termination
of the program.
SEE ALSO : RegisterDynamicNoDipose
}
PROCEDURE RegisterDynamicNoDispose(Name:pChar; Addr:Pointer);
{
PURPOSE : Registers a pChar with the script interpreter. The
string is not disposed by the interpreter upon termination
of the program. You must check for a non-NIL value and
call StrDispose yourself!
SEE ALSO : RegisterDynamic
}
PROCEDURE RegisterLongInt(Name:pChar; Addr:Pointer);
{
PURPOSE : Registers a LongInt with the script interpreter.
EXAMPLE : RegisterLongInt('RandSeed',@System.RandSeed);
}
PROCEDURE RegisterString(Name:pChar; Addr:Pointer; Len:Byte);
{
PURPOSE : Registers a null-terminated string with the script
interpreter. The interpreter is free to assign strings
of any length to the variable, up to the specified
maximum length.
}
PROCEDURE RegisterTPString(Name:pChar; Addr:Pointer; Len:Byte);
{
PURPOSE : Registers a Turbo Pascal string with the script interpreter.
You must specify the maximum length of the string (not the
current length or memory size of the string!).
EXAMPLE : RegisterTPString('YourString',@YourString,255);
}
PROCEDURE RegisterWord(Name:pChar; Addr:Pointer);
{
PURPOSE : Registers a Word with the script interpreter.
EXAMPLE : RegisterWord('LastMode',@CRT.LastMode);
}
IMPLEMENTATION
{ The source code is available upon registration. }
END.